package com.etoak.stock.job;

import com.etoak.stock.service.StockTimerTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author by 孙有泽
 * @Date 2024/10/20 10:57
 * @Description 定义xxljob任务执行器
 */




@Component
public class StockJob {
    @Autowired
    private StockTimerTaskService stockTimerTaskService;
    @XxlJob("myJobHandler")
    public void jobTest(){
        System.out.println("当前时间点："+ DateTime.now().toString("yyyy-MM-dd HH:mm:ss"));
    }
    /**
     * 定时采集A股数据
     */
    @XxlJob("getInnerMarketInfo")
    public void getStockInfos(){
        stockTimerTaskService.getInnerMarketInfo();
    }
    /**
     * 定时个股数据
     */
    @XxlJob("getStockRtIndex")
    public void getStockRtIndex(){
        stockTimerTaskService.getStockRtIndex();
    }
}
